home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / v10n15.arc / DIALMODE < prev    next >
Text File  |  1991-08-09  |  2KB  |  43 lines

  1. ***********************************************************************
  2. * PROCEDURE DialModem - Illustrate the basic technique for dialing a
  3. * phone number through a modem using the FoxPro low-level file
  4. * input/output functions.  No error checking.
  5. ***********************************************************************
  6. PROCEDURE DialModem
  7. PARAMETERS Comport, Phonenum
  8. PRIVATE Modem
  9. Modem = FOPEN(Comport,2)    && Open port for read/write access
  10.  
  11. =FPUTS(Modem, 'ATDT'+Phonenum)  && Dial the modem
  12.  
  13. DO msgwin WITH "Lift handset while ringing, press any key when connected",;
  14.   "","Press any key or click on the mouse now to cancel",;
  15.      "Dialing: "+phonenum+" on "+Comport
  16.  
  17. =FPUTS(Modem, '+++ATH0')    && Hang-up command
  18.  
  19. =FCLOSE(Modem)              && Close the port
  20.  
  21. RETURN
  22.  
  23. ***********************************************************************
  24. * PROCEDURE msgwin - Displays some messages in a window and waits for
  25. * a keypress or mouse click
  26. ***********************************************************************
  27. PROCEDURE msgwin                       && Display window to user
  28. PARAMETER text, text1, text2, text3
  29. PRIVATE xx, xy, xxx, xyy
  30. xx = (SROWS() - 6)/2
  31. xy = (SCOLS() - 60)/2
  32. xxx = xx + 6
  33. xyy = xy + 61
  34.  
  35. DEFINE WINDOW msgwin FROM xx,xy TO xxx,xyy TITLE '&text3'
  36. ACTIVATE WINDOW msgwin
  37. @ 1, (60 - LEN(text))/2 SAY text
  38. @ 2, (60 - LEN(text1))/2 SAY text1
  39. @ 4, (60 - LEN(text2))/2 SAY text2
  40. =INKEY(0,'HM')                         && wait for keypress or mouse click
  41. RELEASE WINDOW msgwin
  42. RETURN
  43.